<template>
	<view class="emain animated fadeIn faster" mode="aspectFill"
		:style="{ 'background-image': user.background? `linear-gradient(rgba(255, 255, 255, -2.4), rgba(255, 255, 255, 0.6)),url(${user.background})` : `url('https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%203377.png')` }">
		<view class="position-fixed w-100 z-index-100 pb-1 bg-fff"
			:style="{'paddingTop':$store.state.statusBarHeight+'px','background':'rgba(255,255,255,'+titlebgcolor+')'}">
			<view class="d-flex d-flex-middle d-flex-between" :style="{'height': $store.state.titleBarHeight + 'px'}">
				<view class="pl-2" @click="goBack"><text class="iconfont icon-31fanhui1 font30"
						:style="{'color': textColor}"></text></view>
				<view class="color000 font-bold" :style="{'opacity': titleOp}">{{user.nickname}}</view>
				<text class="iconfont icon-gengduo mr-3 font32" @click="OpenMorePopup"
					:style="{'color': textColor}"></text>
			</view>
		</view>
		<view :style="{paddingTop:$store.state.statusBarHeight+'px',height: $store.state.titleBarHeight + 'px'}"></view>
		<view class="ml-2 mt-6 mb-3">
			<view class="position-relative mb-5">
				<image class="rounded ml-3" :src="user.avatar" mode="aspectFill"
					style="width: 150rpx;height: 150rpx; border: 1px solid #fff;"></image>
				<view v-show="hasAvatarFrams && device" class="position-absolute wh215"
					style="top: -30rpx; left: -3rpx;">
					<l-svga ref="svga"></l-svga>
				</view>
				<view v-show="hasAvatarFrams && !device" class="position-absolute wh215"
					style="top: -30rpx; left: -3rpx;">
					<image :src="iconFile" class="wh215"></image>
				</view>
			</view>

			<view class="d-flex d-flex-middle">
				<view class="d-flex">
					<view
						:class="['colorfff', 'font-bold', 'mr-2', user.accountType===2? 'VipText' : user.accountType===3? 'SvipText' : '']"
						style="font-size: 42rpx; ">{{user.nickname}}</view>
					<view class="d-flex-btn" style="">
						<image v-if="user.accountType==2"
							src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/svip-y.png"
							style="width: 110rpx;height: 36rpx;margin-top: 6rpx;"></image>
						<image v-if="user.accountType==3"
							src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E5%9B%BE%E5%B1%82%207%402x.png"
							style="width: 110rpx;height: 36rpx;margin-top: 6rpx;"></image>
					</view>
				</view>

				<view class="d-flex-btn mr-2">
					<view class="sex d-flex-btn mr-1 ml-2">
						<image v-if="user.gender==1"
							src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%94%B7.png"
							style="width: 30rpx; height: 30rpx;"></image>
						<image v-if="user.gender==2"
							src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%203404.png"
							style="width: 30rpx; height: 30rpx;"></image>
					</view>
					<view class="colorfff font22">ID:{{user.uid}}</view>
				</view>

				<view class="d-flex-btn" v-if="user.onlineStatus == 1">
					<view class="online-status mr-1" :style="{ 'background-color': getStatusColor(user.onlineStatus) }">
					</view>
					<view class="font22 colorfff font22">在线</view>
				</view>
			</view>
			<view class=" mb-2" style="overflow: hidden;">
				<view v-if="user.ipProvince" class="colorfff mt-1">IP属地：{{user.ipProvince.slice(0, -1)}}</view>
			</view>
			<view class="colorfff font28 mt-5 d-flex mb-2">
				<view class="mr-3">
					<text class="font-bold font32">{{user.fansCount}}</text>
					粉丝
				</view>
				<view class="mr-3">
					<text class="font-bold font32">{{user.concernCount}}</text>
					关注
				</view>
				<view class="mr">
					<text class="font-bold font32">{{user.favorCount}}</text>
					获赞
				</view>
				<image @click="favor(user)"
					:src="user.favorFlag? 'https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/fav-red.png' : 'https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/fav.png'"
					style="width: 35rpx; height: 35rpx;"></image>
			</view>
			<view class="colorfff font26 mb-2">{{user.signature}}</view>
			<!-- <scroll-view scroll-x class="scroll-wrapper mb-3" show-scrollbar="false">
			<view class="d-flex " >
			<view class="  d-flex d-flex-middle m-2" v-for="(item,index) in Dazi" :key="index" >
				<image class="game-icon" :src="item.gameAvatar" style="width: 60rpx; height: 60rpx;border-radius: 10%;"></image>
				<text class=" game-name colorfff ml-2 mr-1">{{item.gameName}}</text>
				<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E8%B7%AF%E5%BE%84%2034.png" style="width: 20rpx; height: 20rpx;"></image>
			</view>
			</view>
			</scroll-view> -->
		</view>
		<view class="bg-fff"
			style="width: 100%; min-height: 50vh; margin: 0 auto; border-radius: 30rpx 30rpx 0 0; overflow: hidden;">
			<view class="d-flex mt-5 mb-4 ml-2">
				<view class="d-flex-column d-flex-middle" v-for="i in tabList" :key="i.id" @click="changeTabs(i.id)">
					<view :class="['font32','font-bold','mb-1', currentTab == i.id? 'currentTab' : '']"
						style="color: #878787; padding: 0 20rpx;">{{i.title}}</view>
					<view v-if="currentTab == i.id" class="rounded15"
						style="width: 60rpx; height: 12rpx; background-color: #2ca5df;"></view>
				</view>
			</view>
			<view class="pb-3">
				<view class="" v-if="currentTab == 0&&blog.length!=0" v-for="(item,index) in blog" :key="index">
					<view v-if="blog.length!=0" class="" style="width: 92%; margin: 40rpx auto;">
						<view class="d-flex" style="align-items: baseline;">
							<view v-if="item.id==topid" class="d-flex-btn"
								style="font-size: 22rpx;margin-top: 0rpx;margin-right: 10rpx; background-color: cornflowerblue;letter-spacing: 1px;padding: 4rpx; border-radius: 8rpx; color: white;">
								置顶</view>
							<view class="font-bold font20 mb-1" style="color: #878787;">{{item.gmtCreated}}</view>
						</view>
						<view class="font28 mb-2">{{item.remark}}</view>
						<view class="topic-list" v-if="item.topicNames">
							<view v-for="(topic, index) in item.topicNames.split(',')" :key="index">
								<view class="topic-content px-2 py-1">
									<text class="topic-hash">#</text>
									<text class="topic-name">{{topic}}</text>
								</view>
							</view>
						</view>
						<view class="d-flex  d-flex-middle">
							<image v-if="item.screenshot1" :src="item.screenshot1" @load="ImgSize($event, index)"
								@click.stop="previwImage(index,0)"
								:class="['rounded15',{'MorePic':item.screenshot2&&!item.screenshot3},{'threePic':item.screenshot2&&item.screenshot3}]"
								:mode="item.screenshot2? 'aspectFill' : 'widthFix'"
								:style="[{maxWidth: item.isLongChart? '550rpx' : '660rpx'}]"></image>
							<image
								:class="['rounded15', 'ml-1', item.screenshot2&&!item.screenshot3? 'MorePic' : 'threePic']"
								v-if="item.screenshot2" :src="item.screenshot2" mode="aspectFill"
								@click.stop="previwImage(index,1)"></image>
							<image :class="['rounded15', 'ml-1', 'mr-2', item.screenshot3? 'threePic' : '']"
								v-if="item.screenshot3" :src="item.screenshot3" mode="aspectFill"
								@click.stop="previwImage(index,2)"></image>

						</view>
						<view class="d-flex-between" style="display: flex; height: 132rpx;">
							<view class="d-flex d-flex-middle" @click.stop="dianzan(item.id)">
								<image v-if="item.favorFlag"
									src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/heart-3-fill.png"
									style="width: 35rpx; height: 35rpx;"></image>
								<text v-else class="iconfont icon-aixin1 color6d"></text>
								<text class="color71 font26 ml-1">{{item.favorCount}}</text>
							</view>
							<view class="d-flex d-flex-middle" @click="gotoDetail(item)">
								<text class="iconfont icon-pinglun color6d"></text>
								<text
									class="color71 font26 ml-1">{{item.totalCommentCount == 0? '' : item.totalCommentCount}}</text>
							</view>
						</view>
					</view>
				</view>
				<view v-else-if="currentTab == 0&&blog.length==0" style="width: 100%;">
					<text class="position-relative d-flex font-bold font30"
						style="   justify-content: center;align-items: center; top: 405rpx;">该用户暂时还没有发布动态</text>
					<image class="position-relative" style="top: -84rpx;left: 58rpx;width: 80%;"
						src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/xiaoda.png"></image>
				</view>
			</view>
			<view class="" v-if="currentTab == 1">
				<view class="" style="width: 92%; margin: 0 auto;">
					<view class="font34 mb-5 ml-1 font-bold" style="color: #878787;">账号等级</view>
					<view class="d-flex d-flex-around mb-3">
						<view class="level d-flex d-flex-column d-flex-middle mr-2">
							<text class="mb-1">魅力值</text>
							<image class="mb-1"
								src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/huizhang3.png"
								mode="heightFix" style="height: 120rpx;"></image>
							<image :src="user.charmValueIcon" style="    width: 96rpx;height: 36rpx;"></image>
						</view>
						<view class="level d-flex d-flex-column d-flex-middle mr-2">
							<text class="mb-1">财富值</text>
							<image class="mb-1"
								src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/huizhang1.png"
								mode="heightFix" style="height: 120rpx;"></image>
							<image :src="user.wealthValueIcon" style="    width: 96rpx;height: 44rpx;"></image>
						</view>
						<view class="level d-flex d-flex-column d-flex-middle">
							<text class="mb-1">等级</text>
							<image class="mb-1"
								src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/huizhang2.png"
								mode="heightFix" style="height: 120rpx;"></image>
							<image :src="user.experienceValueIcon" style="    width: 96rpx;height: 46rpx;"></image>
							<!-- <text class="font-bold font22">Lv.30</text> -->
						</view>
					</view>
					<!-- <view class="font34 mb-4 ml-1 font-bold" style="color: #878787;">个性签名</view>
					<view class="mb-4" style="overflow: hidden;">
						<view class="text-center mt-6 mb-7">{{user.signature}}</view>
					</view> -->
					<!-- 	<view class="d-flex d-flex-between">
						<view class="font34 ml-1 font-bold" style="color: #878787;">勋章墙</view>
						<view class="d-flex-btn">
							<image class="mr-3" src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%204533.png" style="width: 50rpx; height: 70rpx;"></image>
							<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E8%B7%AF%E5%BE%84%2051006.png" style="width: 20rpx; height: 30rpx;"></image>
						</view>
					</view> -->
					<!-- <view class="font34 ml-1 mt-100 font-bold mb-2" style="color: #878787;">礼物墙</view>
					<view class="d-flex d-flex-between d-flex-middle mb-3" style="background-image: url(https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%202223.png); width: 100%; height: 76rpx; background-size: 100%; 100%">
						<view class="d-flex-btn">
							<image class="ml-4 mr-2" src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%202585.png" style="width: 50rpx; height: 40rpx;"></image>
							<text class="font-bold" style="color: #ffdbaa;">礼物图鉴</text>
						</view>
						<view class="font-bold mr-6" style="color: #ffdbaa;">已集齐：0</view>
					</view> -->
					<!-- <view class="colorfff py-2 text-center rounded50 font30" style="background: #C0D4FF; width: 50%; margin: 0 auto;">十二星座-处女座</view>
					<view class="mb-7 d-flex d-flex-between mt-3">
						<view class="d-flex-column d-flex-middle" style="width: 38%;">
							<view class="px-2 py-1 rounded15 d-flex-btn" style="background: #dfe7f8; display: inline-block;">
								<text class="mr-2 ml-1" style="color: #C0D4FF;">星座成就</text>
								<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E8%B7%AF%E5%BE%84%2051016.png" style="width: 25rpx; height: 35rpx;"></image>
							</view>
							<image class="pt-3 pb-2" src="https://168809.oss-cn-hangzhou.aliyuncs.com/community/temp/level1.png" mode="heightFix" style="height: 200rpx;"></image>
							<text class="font30" style="color: #878787;">未点亮</text>
						</view> -->
					<!-- <view class="d-flex-column d-flex-middle" style="width: 62%;">
							<view class="">
								<view class="px-2 py-1 rounded15 d-flex-btn" style="background: #dfe7f8; display: inline-block;">
									<text class="mr-2 ml-1" style="color: #C0D4FF;">星座成就</text>
									<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E8%B7%AF%E5%BE%84%2051016.png" style="width: 25rpx; height: 35rpx;"></image>
								</view>
							</view>
							<view class="d-flex d-flex-between d-flex-middle" style="flex: 1;">
								<view class="d-flex-column d-flex-middle mr-3">
									<image class="pt-5 pb-1" src="https://168809.oss-cn-hangzhou.aliyuncs.com/community/temp/level1.png" mode="heightFix" style="height: 130rpx;"></image>
									<text class="font30">礼物</text>
									<text class="font30 mt-2" style="color: #878787;">未获得</text>
								</view>
								<view class="d-flex-column d-flex-middle ml-4">
									<image class="pt-5 pb-1" src="https://168809.oss-cn-hangzhou.aliyuncs.com/community/temp/level3.png" mode="heightFix" style="height: 130rpx;"></image>
									<text class="font30">礼物</text>
									<text class="font30 mt-2" style="color: #878787;">未获得</text>
								</view>
							</view>
						</view> -->
				</view>
				<view class="mb-5 d-flex d-flex-between d-flex-middle" style="width: 92%; margin: 0 auto;">
					<view class="d-flex font32">
						<view :class="['mr-2','py-1','px-3', 'rounded30', currentGiftTab == 0? 'currentGiftTab' : '']"
							@click="changGiftTab(0)">近90天</view>
						<view :class="['py-1','px-3', 'rounded30', currentGiftTab == 1? 'currentGiftTab' : '']"
							@click="changGiftTab(1)">全部</view>
					</view>
					<!-- <view class="font30 font-bold" style="color: #99999a;">
							<text>未收到 </text>
						</view> -->
				</view>
				<view class="giftList" v-if="currentGiftTab == 0">
					<view class="item" v-if="gift.length != 0" v-for="i in gift" :key="i.id">
						<image :src="i.icon"></image>
						<view class="giftName mt-1">{{i.name}}</view>
						<view class="quantity">×{{i.count}}</view>
					</view>
					<view v-else style="width: 100%;">
						<view v-if="Loading" class="rounded60 d-flex d-flex-center d-flex-middle"
							style="background-color: #f5f5f5;height: 1060rpx;">
							<text class="color999 font26">加载中...</text>
						</view>
						<view v-else>
							<text class="position-relative font-bold font30 d-flex"
								style="  justify-content: center;align-items: center; top: 500rpx;">您暂时还没有收到礼物</text>
							<image class="position-relative top-0" style="left: 58rpx;width: 80%;"
								src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/xiaoda.png"></image>
						</view>
					</view>
				</view>
				<view class="giftList" v-if="currentGiftTab == 1">
					<view class="item" v-if="gift.length != 0" v-for="i in gift" :key="i.id">
						<image :src="i.icon"></image>
						<view class="giftName mt-1">{{i.name}}</view>
						<view class="quantity">×{{i.count}}</view>
					</view>
					<view v-else style="width: 100%;">
						<view v-if="Loading" class="rounded60 d-flex d-flex-center d-flex-middle"
							style="background-color: #f5f5f5;height: 1060rpx;">
							<text class="color999 font26">加载中...</text>
						</view>
						<view v-else>
							<text class="position-relative font-bold font30 d-flex"
								style="  justify-content: center;align-items: center; top: 500rpx;">您暂时还没有收到礼物</text>
							<image class="position-relative top-0"
								style="left: 50%; transform: translateX(-50%); width: 80%;"
								src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/xiaoda.png"></image>
						</view>
					</view>
				</view>
			</view>
		</view>
		<!-- <view class="position-relative" v-if="currentTab == 2">
				<view class="mx-3 mb-2 d-flex d-flex-around colorfff rounded50 font32" style="background: #c7c9ca; width: 330rpx;">
					<view :class="['rounded50', 'text-center', bosomFriendTab == 0? 'friendtab-b' : '']" @click="ChangebosomFriendTab(0)" style="width: 150rpx; padding: 8rpx 0 10rpx;">挚友柜</view>
					<view :class="['rounded50', 'text-center', bosomFriendTab == 1? 'friendtab-p' : '']" @click="ChangebosomFriendTab(1)" style="width: 180rpx; padding: 8rpx 0 10rpx;">挚友小屋</view>
				</view>
				<view class="mx-1 pb-10 mb-2" v-if="bosomFriendTab == 0" style="background-image: url(https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%204552.png); background-size: 100% auto; background-repeat: no-repeat; min-height: 70vh; overflow: hidden;">
					<view class="rounded50 position-absolute d-flex-btn mt-3 ml-3" style="background-color: #C0D4FF; width: 220rpx;">
						<view class="">共</view>
						<text class="font50 px-1">5</text>
						<view class="">位挚友</view>
					</view>
					<view class="d-flex d-flex-center position-relative" style="top: 25rpx;">
						<view class="d-flex font32 d-flex-center" style="width: 100%; height: 380rpx; background-image: url(https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%201751.png); background-size: 58% auto; background-repeat: no-repeat; background-position: 200rpx -20rpx;">
							<view class="d-flex-column mt-2 d-flex-middle d-flex-center">
								<image src="https://168809.oss-cn-hangzhou.aliyuncs.com/community/temp/chat03.png" mode="heightFix" style="height: 160rpx; border: 2px solid #d5d4d3; border-radius: 50%;"></image>
								<text class="mt-1">九天</text>
							</view>
							<view class="d-flex d-flex-bottom d-flex-end mb-3">
								<view class="">一起</view>
								<view class="font40 font-bold px-2">177</view>
								<view class="">天</view>
							</view>
							<view class="d-flex-column mt-2 d-flex-middle d-flex-center">
								<image src="https://168809.oss-cn-hangzhou.aliyuncs.com/community/temp/chat03.png" mode="heightFix" style="height: 160rpx; border: 2px solid #d5d4d3; border-radius: 50%;"></image>
								<text class="mt-1">花言</text>
							</view>
						</view>
						<view class="position-absolute" style="top: 12%;">
							<image class="position-absolute" src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%201755.png" mode="heightFix" style="height: 55rpx; left: -6rpx; top: -6rpx;"></image>
							<view class="colorfff linerbg rounded50" style="padding: 2rpx 10rpx 6rpx 65rpx;">初见之欢</view>
						</view>
						<view class="position-absolute" style="top: 26%; left: 290rpx;">
							<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%201771.png" mode="heightFix" style="height: 180rpx;"></image>
						</view>
					</view>
					<view class="position-absolute" style="top: 100rpx; left: 25%; filter: blur(4px);">
						<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E8%92%99%E7%89%88%E7%BB%84%203.png" mode="heightFix" style="height: 400rpx;"></image>
					</view>
					<view class="d-flex d-flex-between mt-3 d-flex-wrap px-3">
						<view class="d-flex-column d-flex-middle  position-relative" v-for="i in 4" :key="i.id" style="background-image: url(https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%204429.png); width: 29%; height: 350rpx; background-size: 100% auto; background-repeat: no-repeat;">
							<view class="mt-6 font-bold font26" style="color: #fff4c0; margin-bottom: 15rpx;">LV.23 知己</view>
							<image src="https://168809.oss-cn-hangzhou.aliyuncs.com/community/temp/chat03.png" mode="heightFix" style="height: 65rpx; border: 1px solid #d5d4d3; border-radius: 50%;"></image>
							<view class="position-absolute" style="top: 49%;">
								<image class="position-absolute" src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%201755.png" mode="heightFix" style="height: 40rpx; left: -6rpx; top: -2rpx;"></image>
								<view class="colorfff linerbg rounded50 font20" style="padding: 2rpx 10rpx 6rpx 35rpx;">初见之欢</view>
							</view>
							<view class="font20 mt-4">7737.摇光(国野)</view>
							<view class="font26 font-bold mt-1">一起977天</view>
						</view>
					</view>
				</view>
				<view class="mx-3 d-flex d-flex-center position-relative pb-15 mb-15" v-if="bosomFriendTab == 1" style="min-height: 55vh;">
					<view class="d-flex font32 d-flex-center" style="width: 100%; background-image: url(https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%201751.png); background-size: 70% auto; background-repeat: no-repeat; background-position: 120rpx 180rpx;">
						<view class="d-flex-column d-flex-middle d-flex-center mr-4">
							<image src="https://168809.oss-cn-hangzhou.aliyuncs.com/community/temp/chat03.png" mode="heightFix" style="height: 160rpx; border: 2px solid #d5d4d3; border-radius: 50%;"></image>
							<text class="mt-1">九天</text>
						</view>
						<view class="d-flex-column d-flex-middle d-flex-center ml-4">
							<image src="https://168809.oss-cn-hangzhou.aliyuncs.com/community/temp/chat03.png" mode="heightFix" style="height: 160rpx; border: 2px solid #d5d4d3; border-radius: 50%;"></image>
							<text class="mt-1">花言</text>
						</view>
					</view>
					<view class="position-absolute" style="top: 26%;">
						<image class="position-absolute" src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%201755.png" mode="heightFix" style="height: 60rpx; left: -10rpx; top: -6rpx;"></image>
						<view class="colorfff linerbg rounded50" style="padding: 2rpx 10rpx 6rpx 65rpx;">初见之欢</view>
					</view>
					<view class="position-absolute" style="top: 32%;">
						<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%201771.png" mode="heightFix" style="height: 180rpx;"></image>
					</view>
				</view>
				<view class="d-flex-btn friendbtn-bg position-fixed" style="right: 50rpx; bottom: 240rpx;" @click="gotoBosomFriendValuePage">成为挚友</view>
			</view> -->
		<view class="" v-if="currentTab == 3">

		</view>
	</view>
	<view class="d-flex d-flex-around position-fixed pt-10 pb-4"
		style="bottom: 0; width: 100%; left: 50%; transform: translateX(-50%); background: linear-gradient(180deg, transparent 0%, #fff 40%, #fff 69%, #fff 99%);">
		<view class="d-flex-btn btn-edit" @click="concernUser(uid)">
			<image v-if="user.concernFlag"
				src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/heart-3-fill.png"
				style="width: 40rpx; height: 40rpx;"></image>
			<image v-else
				src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E8%B7%AF%E5%BE%84%20275.png"
				style="width: 35rpx; height: 35rpx;"></image>
			<text class="ml-1">{{user.concernFlag?'已关注':'关注'}}</text>
		</view>
		<view class="d-flex-btn btn-edit" @click="toim(user)">
			<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E8%B7%AF%E5%BE%84%20275.png"
				style="width: 35rpx; height: 30rpx;"></image>
			<text class="ml-1">打招呼</text>
		</view>
	</view>
	<uni-popup ref="MorePopup" background-color="#fff" border-radius="16px 16px 0 0" style="z-index: 999;">
		<view class="d-flex d-flex-middle mt-3 ml-2 py-2" @click="Block('none')">
			<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E9%BB%91%E5%90%8D%E5%8D%95.png"
				mode="heightFix" style="height: 40rpx; width: 40rpx;"></image>
			<text class="font32 ml-3">拉黑</text>
		</view>
		<view class="d-flex d-flex-middle py-2 mb-2 ml-2" @click="Block('report')">
			<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E6%8B%89%E9%BB%91.png"
				mode="heightFix" style="height: 40rpx; width: 40rpx;"></image>
			<text class="font32 ml-3">拉黑并举报</text>
		</view>
	</uni-popup>
	<uni-popup ref="SendGiftPopup" background-color="#e5f9fb" border-radius="16px 16px 0 0" style="z-index: 999;">
		<view class="p-3 d-flex d-flex-between d-flex-middle">
			<view class="font32">Ta太受欢迎，快忙不过来啦</view>
			<view class="rounded bg-fff d-flex-btn" style="width: 75rpx; height: 75rpx;">
				<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/love-pink.png"
					style="width: 40rpx; height: 36rpx;"></image>
			</view>
		</view>
		<view class="mx-3 rounded10 bg-fff text-center"
			style="color: #bcc0c5; padding: 45rpx; 35rpx 60rpx; box-sizing: border-box;">
			今天找Ta的人有点多，为了减少过多的打抗，请明天再来找Ta，或送个小礼物表达诚意
		</view>
		<view class="mx-3 bg-fff d-flex" style="width: 690rpx; height: 250rpx; overflow-x: scroll; flex-wrap: nowrap;">
			<view
				:class="['h-100', 'bg-fff', 'ml-2', 'rounded20', idx==9? 'mr-2' : '', SendGiftIdx == idx? 'currenSendGift' : '']"
				style="width: 165rpx; min-width: 185rpx; border: 2px solid #f6f6f6; box-sizing: border-box;"
				v-for="(item, idx) in sendGiftList" :key="idx" @click="SendGiftIdx = idx">
				<image :src="item.icon" style="width: 135rpx; height: 135rpx; margin: 10rpx 22rpx;"></image>
				<text class="w-100 px-2 text-clamp text-center"
					style="color: #414657; box-sizing: border-box;">{{ item.name }}</text>
				<view class="d-flex-btn mt">
					<image src="https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%201941.png"
						style="width: 32rpx; height: 32rpx;"></image>
					<text style="color: #9ea4ac;"
						class="ml font28">{{ device? item.androidCoinPrice : item.iosCoinPrice }}</text>
				</view>
			</view>
		</view>
		<view class="mx-3 px-2 d-flex d-flex-middle d-flex-between bg-fff pt-5">
			<view @click="gotomember" class="rounded50 bg-fff text-center py-3 colorfff span-9 font28"
				style="background-image: linear-gradient(to right, #ef9a89, #db8cce, #cb85f7, #82a3f8);">VIP 直接聊</view>
			<view class="rounded50 bg-fff text-center py-3 colorfff span-9 font28"
				style="background-image: linear-gradient(to right, #ef9a89, #db8cce, #cb85f7, #82a3f8);"
				@click="CheckSendGift">送礼开聊</view>
		</view>
		<view class="mx-3 bg-fff d-flex-btn" style="border-radius: 0 0 20rpx 20rpx;">
			<view class="my-3" style="color: #a9aeb5;" @click="CloseSendGiftPopup">先不聊了</view>
		</view>
	</uni-popup>

	<uni-popup ref="moneyPopup" type="dialog" style="position: relative; z-index: 999999;">
		<uni-popup-dialog cancelText="取消" confirmText="去充值" title="提示" content="当前礼物数量不足，购买后才可以继续送礼，是否去购买？"
			@confirm="confirmMoney" @close="colseMoneyPopup"></uni-popup-dialog>
	</uni-popup>

	<uni-popup ref="RechargePopup" background-color="#fff" border-radius="16px 16px 0 0" style="z-index: 999;">
		<view class="d-flex d-flex-column px-3 pt-3">
			<view class="d-flex d-flex-middle d-flex-between mb-3" v-for="(item, idx) in PayList" :key="item.id"
				@click="changePayOpt(idx)">
				<view class="d-flex d-flex-middle">
					<image :src="item.icon" style="width: 64rpx; height: 64rpx;"></image>
					<text class="font28 ml-2">{{item.name}}</text>
				</view>
				<view :class="['rounded',item.checked? 'ActiveRadio' : 'Radio']"></view>
			</view>
			<view class="colorfff rounded50 text-center py-2 font32"
				style="background-image: linear-gradient(to right, #ef9a89, #db8cce, #cb85f7, #82a3f8); width: 80%; margin: 0 auto 30rpx;"
				@click="confirmPay">
				确认支付
			</view>
		</view>
	</uni-popup>
</template>

<script>
	import {
		manner
	} from "@/util/manner.js";
	import {
		userApi
	} from "../../http/userApi";
	import {
		TaskApi
	} from "../../http/taskApi";
	import {
		PayApi
	} from "../../http/PayApi";
	import {
		blogApi
	} from '../../http/blogApi';
	import {
		giftApi
	} from '@/http/giftApi.js';
	import {
		DaziApi
	} from "../../http/Dazi";
	import store from '@/store/index.js';
	import {
		dateUtils
	} from '@/util/util.js';
	export default {
		data() {
			return {
				textColor: '#fff',
				svgaFile: null,
				iconFile: null,
				hasAvatarFrams: false,
				device: null,
				SendGiftIdx: 0,
				isRequesting: false,
				orderStr: null,
				WxpayParams: {},
				uid: 0, //用户id
				params: { //礼物参数
					fromType: 2, // 送出/接收 礼物
					type: 1, // 90天 / 全部
					pageIndex: 1,
					pageSize: 10,
					isLastPage: false // 是否是最后一页
				},
				gift: [], //礼物列表
				payIndex: 0,
				sendGiftList: [],
				param: {
					id: 0,
					status: 1
				},
				concernFlag: false, //是否关注
				concernParam: { //关注
					bindFlag: true,
					fromUid: '',
					toUid: '',
					type: 2
				},
				BlockParams: {
					toUid: null,
					type: 6
				},
				blogParam: {
					pageIndex: 1,
					pageSize: 4,
					status: 1,
					uid: 0
				}, //博客参数
				Loading: true,
				systemInfo: uni.getSystemInfoSync(),
				topid: '',
				blog: [], //博客数组
				user: {}, //用户信息
				titlebgcolor: 0,
				titleOp: 0,
				imgs: [],
				Dazi: [],
				GiftList: [],
				currentTab: 0,
				isLastPage: false,
				currentGiftTab: 0,
				bosomFriendTab: 0,
				device: null,
				tabList: [{
						id: 0,
						title: ''
					},
					{
						id: 1,
						title: '关于Ta'
					}
				],
				PayList: [{
						id: 0,
						icon: 'https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20241115141319.png',
						name: '支付宝',
						desc: '推荐',
						value: 'Alipay',
						checked: true
					},
					{
						id: 1,
						icon: 'https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/Pay-Wechat.png',
						name: '微信',
						desc: '',
						value: 'Wechat',
						checked: false
					},
					{
						id: 2,
						icon: 'https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E7%BB%84%20554.png',
						name: '嗒币',
						desc: '',
						value: 'DaBi',
						checked: false
					}
				]
			}
		},
		onLoad() {
			uni.getSystemInfo({
				success: (res) => {
					this.device = res.osName === 'android' ? 1 : 2
				}
			});
		},
		onPageScroll(e) {
			let scrollTop = e.scrollTop
			this.titleOp = Math.round(scrollTop - 50) / 100
			this.titlebgcolor = Math.round(scrollTop - 50) / 100
			if (scrollTop < 65) {
				this.textColor = '#ffffff'
			} else {
				this.textColor = '#000000'
			}
		},
		onReachBottom() {
			if (this.currentTab == 0) {
				if (!this.isLastPage) {
					this.blogParam.pageIndex += 1;
					this.getBlog();
				}
			}
			if (this.currentGiftTab == 0 || this.currentGiftTab == 1) {
				if (!this.params.isLastPage) {
					this.params.pageIndex += 1;
					this.getGiftData();
				}
			}
		},
		methods: {
			OpenMorePopup() {
				this.$refs.MorePopup.open('bottom')
			},
			OpenSendGiftPopup() {
				this.$refs.SendGiftPopup.open('bottom')
			},
			CloseSendGiftPopup() {
				this.$refs.SendGiftPopup.close()
			},
			colseMoneyPopup() {
				this.$refs.moneyPopup.close()
			},
			confirmMoney() {
				this.$refs.RechargePopup.open('bottom')
			},
			gotomember: dateUtils.debounce(function() {
				uni.navigateTo({
					url: '/pagesMain/member/member'
				})
			}, 1000),
			confirmPay() {
				if (this.isRequesting) {
					console.log("请求已在处理中，5秒内不再重复发送请求。");
					return;
				}
				let params = {
					count: 1,
					id: this.sendGiftList[this.SendGiftIdx].id,
					sourceType: this.systemInfo.osName === 'ios' ? 2 : 1
				}
				this.isRequesting = true

				this.createGiftOrder(params).then((resolve) => {
					let PayParams = {
						orderNo: resolve,
						payMethod: this.payIndex == 0 ? 2 : this.payIndex == 1 ? 3 : 1, //0-wx,1-zfb，2-余额
						payType: this.payIndex == 2 ? 1 : 2
					}
					console.log(PayParams);
					this.createPay(PayParams);
				});
				setTimeout(() => {
					this.isRequesting = false;
				}, 5000);
			},
			async createGiftOrder(params) {
				let res = await PayApi.BuyGifts(params);
				return res.orderNo
			},
			// 支付单
			async createPay(PayParams) {
				let res = await PayApi.Pay(PayParams);
				// 支付宝支付
				if (PayParams.payMethod === 3) {
					this.orderStr = res.params.orderStr
					console.log('支付宝支付');
					this.payByAlipay();
					return
				}
				// 微信支付
				if (PayParams.payMethod === 2) {
					this.WxpayParams = {}
					this.WxpayParams = res.params
					console.log('微信支付');
					this.payByWxpay();
					return
				}
				// 嗒币支付
				if (PayParams.payMethod === 1) {
					if (res.paySuccess) {
						uni.showToast({
							title: '购买成功',
							icon: 'none',
							duration: 1500
						});
						uni.showLoading({
							icon: 'none',
							title: '加载中...'
						})
						setTimeout(() => {
							this.GetSendGiftList().then(() => {
								this.$refs.RechargePopup.close()
								this.CheckSendGift()
								uni.hideLoading()
							})
						}, 8000)
					}
				}
			},
			// 支付宝支付
			payByAlipay() {
				const orderStr = this.orderStr;
				if (!orderStr) {
					console.error('订单字符串为空，无法进行支付');
					return;
				}
				// 调用 uni.requestPayment 方法
				uni.requestPayment({
					provider: 'alipay', // 指定支付提供商为支付宝
					orderInfo: orderStr, // 订单信息
					success: (res) => {
						uni.showToast({
							title: '支付成功',
							icon: 'none',
							position: 'bottom',
							duration: 1000 // 显示持续时间
						});
					},
					fail: (err) => {
						console.error('支付失败:', err);
						uni.showToast({
							title: '支付失败',
							icon: 'none',
							position: 'bottom',
							duration: 1000 // 显示持续时间
						});
					}
				});
			},
			// 微信支付
			payByWxpay() {
				uni.requestPayment({
					"provider": "wxpay", // 微信支付
					"orderInfo": {
						"appid": this.WxpayParams.appid,
						"timestamp": this.WxpayParams.timestamp,
						"noncestr": this.WxpayParams.noncestr,
						"package": "Sign=WXPay",
						"partnerid": this.WxpayParams.partnerId,
						"prepayid": this.WxpayParams.prepayId,
						"sign": this.WxpayParams.sign
					},
					success: (res) => {
						// 支付成功的处理逻辑
						uni.showToast({
							title: '支付成功',
							icon: 'none',
							position: 'bottom',
							duration: 1500
						});
					},
					fail: (err) => {
						console.log('支付失败，错误信息：', err);
						if (err.errCode === 'xxx') {
							// 可以根据不同的 errCode 进行不同的处理，这里的 xxx 是具体的错误码，例如用户取消支付的错误码
							console.log('用户取消支付');
						} else if (err.errCode === 'yyy') {
							// 另一种错误码 yyy 的处理
							console.log('签名错误，请联系客服');
						} else {
							console.log('其他支付错误，请重试或联系客服');
						}
						uni.showToast({
							title: '支付失败',
							icon: 'none',
							position: 'bottom',
							duration: 2000
						});
					}
				});
			},
			changePayOpt(idx) {
				this.PayList.forEach(item => {
					item.checked = false
				})
				this.PayList[idx].checked = true
				this.payIndex = idx
			},
			CheckSendGift: dateUtils.debounce(function() {
				if (this.sendGiftList[this.SendGiftIdx].count > 0) {
					let message = this.$tim.createCustomMessage({
						to: this.user.uid,
						conversationType: 'C2C',
						payload: {
							data: 'GIFT',
							description: '送给' + this.user.nickname + ' ' + this.sendGiftList[this
								.SendGiftIdx].name,
							extension: JSON.stringify(this.sendGiftList[this.SendGiftIdx])
						}
					})
					this.$tim.sendMessage(message);
					let params = {
						toUid: this.user.uid,
						giftId: this.sendGiftList[this.SendGiftIdx].id
					}
					this.sendGift(params)
				} else {
					this.$refs.moneyPopup.open()
				}
			}, 1000),
			async sendGift(params) {
				try {
					await giftApi.sendGift({
						'toUid': params.toUid,
						'giftId': params.giftId
					})
					this.CloseSendGiftPopup()
					this.getTaskList(18);
					uni.showToast({
						title: '礼物成功送出！',
						icon: 'none',
						position: 'bottom',
						duration: 1500
					})
					setTimeout(() => {
						const item = {
							uid: this.user.id,
							userUid: this.user.uid,
							name: this.user.nickname,
							avatar: this.user.avatar,
							conversationID: 'C2C' + this.user.uid,
							type: 'C2C'
						}
						uni.navigateTo({
							url: '/message/im/im?to=' + encodeURIComponent(JSON.stringify(item))
						});
					}, 1500)
				} catch (error) {
					console.log('接口请求出错', error);
					uni.showToast({
						title: '礼物赠送失败！',
						icon: 'none',
						position: 'bottom',
						duration: 1500
					})
				}
			},
			// 添加朋友
			addFriend(uid) {
				let that = this
				that.$tim.addFriend({
					to: uid,
					source: 'AddSource_Type_App',
					type: 'Add_Type_Both',
				}).then((imResponse) => {
					const {
						code
					} = imResponse.data;
					if (code === 30539) {} else if (code === 0) {
						console.log('添加好友成功！')
					}
				}).catch((imError) => {
					console.warn('addFriend error:', imError);
				});
			},
			// 删除好友
			deleteFriend(uid) {
				let that = this
				let userIDList = []
				userIDList.push(uid)
				let promise = that.$tim.deleteFriend({
					userIDList: userIDList,
					type: 'Delete_Type_Both'
				});
				promise.then(function(imResponse) {
					const {
						successUserIDList,
						failureUserIDList
					} = imResponse.data;
					// 删除成功的 userIDList
					successUserIDList.forEach((item) => {
						const {
							userID
						} = item;
					});
					// 删除失败的 userIDList
					failureUserIDList.forEach((item) => {
						const {
							userID,
							code,
							message
						} = item;
					});
					// 如果好友列表有变化，则 SDK 会触发 TencentCloudChat.EVENT.FRIEND_LIST_UPDATED 事件
				}).catch(function(imError) {
					console.warn('removeFromFriendList error:', imError);
				});
			},
			// 拉黑
			async BlockOperate(type) {
				console.log(type);
				this.BlockParams.bindFlag = 1
				this.BlockParams.fromUid = this.$store.state.user.uid
				uni.showLoading({
					mask: 'true',
					title: '拉黑中...'
				})
				let res = await userApi.relation(this.BlockParams)
				uni.hideLoading()
				this.$refs.MorePopup.close()
				uni.showToast({
					icon: 'none',
					title: '拉黑成功',
					position: 'bottom',
					duration: 1500
				})
				if (type === 'report') {
					uni.navigateTo({
						url: "/pagesMain/ReportPage/ReportPage?type=3&idRef=" + this.user.id
					})
				}
			},
			async Block(type) {
				uni.showModal({
					content: '拉黑后将不会受到对方发来的消息，可在"隐私与安全-黑名单"中解除，确定拉黑？',
					success: (res) => {
						if (res.confirm) {
							this.BlockOperate(type)
						} else {
							this.$refs.MorePopup.close()
						}
					}
				});
			},
			// 图片预览
			previwImage(id, index) {
				if (this.blog[id].screenshot1) {
					this.imgs.push(this.blog[id].screenshot1)
				}
				if (this.blog[id].screenshot2) {
					this.imgs.push(this.blog[id].screenshot2)
				}
				if (this.blog[id].screenshot3) {
					this.imgs.push(this.blog[id].screenshot3)
				}
				uni.previewImage({
					current: index, // 当前显示图片索引
					urls: this.imgs, // 需要预览的图片http链接列表
				});
				this.imgs = []
			},
			// 创建访客记录
			async addVisitor(uid) {
				console.log(store.state.user.onlineStatus, store.state.user.accountType);
				if (store.state.user.onlineStatus == 3 && store.state.user.accountType == 3) return
				console.log(store.state.user.onlineStatus, store.state.user.accountType);
				this.concernParam.toUid = uid;
				this.concernParam.type = 4;
				let res = await userApi.relation(this.concernParam);
			},
			async GetSendGiftList() {
				let params = {
					pageIndex: 1,
					pageSize: 8
				}
				let res = await giftApi.sendGiftList(params)
				this.sendGiftList = res.records
				console.log(this.sendGiftList);
			},
			async getDazi(uid) { //搭子卡
				let param = {
					pageIndex: 1,
					pageSize: 3,
					uid: uid
				}
				let res = await DaziApi.queryCard(param);
				let records = res.records;
				records.forEach(i => {
					this.Dazi.push(i);
				})
			},
			async getUser() {
				let res = await userApi.getUser(this.param);
				this.user = res;
				this.JudgeHasAvatarFrams()
			},
			// 判断是否设置了头像框
			JudgeHasAvatarFrams() {
				if (!this.user.dressedVoMap['1']) {
					return
				}
				if (this.user.dressedVoMap['1'].svga) {
					this.svgaFile = this.user.dressedVoMap[1].svga
					this.hasAvatarFrams = true
				}
				if (this.user.dressedVoMap['1'].icon) {
					this.iconFile = this.user.dressedVoMap[1].icon
					this.hasAvatarFrams = true
				}

				// 判断设备，APP设置动态头像框，小程序设置静态头像框
				// #ifdef APP
				this.device = true
				// #endif
				//#ifdef MP-WEIXIN
				this.device = false
				// #endif

				// 如果有头像框就设置头像框
				if (this.hasAvatarFrams) {
					if (!this.user.dressedVoMap['1'].svga) {
						this.device = false
					}
					this.setAvatarFrams()
				}
			},
			// 设置动态头像框
			setAvatarFrams() {
				// 只有App才设置动态头像框
				if (this.device) {
					this.$refs.svga.render(async (parser, player) => {
						const videoItem = await parser.load(this.svgaFile);
						await player.setVideoItem(videoItem);
						// 设置动画缩放模式，可选值为 Fill / AspectFill / AspectFit
						player.setContentMode(() => {
							contentMode: 'AspectFill'
						})
						player.startAnimation()
					})
				}
			},
			gotoDetail(item) { // 跳转到详情页
				let data = JSON.stringify(item)
				uni.navigateTo({
					url: '/pagesMain/detail/detail?data=' + data
				})
			},
			getStatusColor(i) { //显示在线状态
				const colors = {
					'1': '#4CAF50', // 绿色，在线
					'2': '#808080', // 灰色，离线
					'3': '#808080' // 隐身
				};
				return colors[i];
			},
			async getGiftData() {
				this.params.uid = this.uid;
				let res = await giftApi.getGift(this.params)
				this.Loading = false;
				const start = this.gift.length;

				if (res.records.length < this.params.pageSize) {
					this.params.isLastPage = true;
				}
				this.gift.splice(start, 0, ...res.records);
			},
			async queryTop() {
				let param = {
					uid: this.blogParam.uid
				}
				let res = await blogApi.queryTopBlog(param);
				if (res) {
					const index = this.blog.findIndex(item => item.id === res.id);
					this.topid = res.id;
					if (index !== -1) {
						const [item] = this.blog.splice(index, 1); // 从原位置删除
						this.blog.unshift(item); // 插入到数组最前面
					} else {
						this.blog.unshift(res); // 如果不存在，直接插入到最前面
					}
				} else {
					return
				}
			},
			async favor(user) {
				console.log(user);
				let params = {
					fromUid: this.$store.state.user.uid,
					toUid: user.uid,
					type: 1
				}
				params.bindFlag = user.favorFlag ? 0 : 1
				user.favorFlag = !user.favorFlag
				user.favorCount = params.bindFlag ? user.favorCount-- : user.favorCount++
				let res = await userApi.relation(params);
			},
			async getBlog() {
				let res = await blogApi.blogPage(this.blogParam)
				let records = res.records;
				res.records.forEach(i => {
					let isLongChart = {
						isLongChart: 1
					}
					i = Object.assign(i, isLongChart);
				});
				const start = this.blog.length;
				this.blog.splice(start, 0, ...records);
				if (this.blogParam.pageIndex == 1) {
					await this.queryTop();
				}
				this.uid = this.param.id;
				if (records.length < this.blogParam.size) {
					this.isLastPage = true
				}
				let count = res.total;
				if (count == 0) {
					this.tabList[0].title = "无动态";
				} else {
					this.tabList[0].title = '动态' + count;
				}
				// console.log(records);
				// console.log(this.concernFlag);
			},
			async concernData(uid) { //关注
				this.concernParam.toUid = uid;
				this.concernParam.type = 2;
				let res = await userApi.relation(this.concernParam);
			},
			async getTaskList(taskid) {
				let params = {
					id: taskid
				}
				let res = await TaskApi.getTaskList(params)
				if (res.records[0].finishFlag) return
				if (!res.records[0].receiveFlag) {
					this.receiveTask(taskid).then(() => {
						this.finishTask(taskid);
					})
				} else {
					this.finishTask(taskid);
				}
			},
			async receiveTask(id) {
				let params = {
					taskId: id
				}
				let res = await TaskApi.ReceiveTask(params)
				console.log('领取完成！');
			},
			async finishTask(id) {
				let params = {
					taskId: id
				}
				let res = await TaskApi.FinishTask(params);
				console.log('任务完成！');
			},
			async dianzan(id) {
				const param = {
					blogId: id,
					flag: true,
					type: 1
				};
				this.blog.forEach(i => {
					if (i.id == id) {
						i.favorFlag = !i.favorFlag;
						if (i.favorFlag) {
							i.favorCount = i.favorCount + 1;
							let res = blogApi.dianzanBlog(param);
						} else {
							i.favorCount = i.favorCount - 1;
							param.flag = false;
							let res = blogApi.dianzanBlog(param);
						}
					}
				})
			},
			checkRealNaem() { //判断是否实名
				// if (this.$store.state.user.realName == '' || this.$store.state.user.realName == null) {
				// 	return false
				// } else {
				// 	return true
				// }
				return
			},
			concernUser(uid) { //关注用户
				if (this.checkRealNaem()) {
					if (this.user.concernFlag) {
						uni.showModal({
							content: '确定不再关注此人？',
							success: (res) => {
								if (res.confirm) {
									this.user.concernFlag = !this.user.concernFlag
									this.concernParam.bindFlag = false;
									this.concernData(uid);
									this.deleteFriend(uid)
								}
							}
						});
					} else {
						this.user.concernFlag = !this.user.concernFlag
						this.concernParam.bindFlag = true;
						this.concernData(uid);
						this.addFriend(uid);
						this.getTaskList(19);
					}
				} else {
					uni.showModal({

						content: '你还没有完成实名认证，请先完成实名认证？',
						confirmText: '去实名',
						success: (res) => {
							if (res.confirm) {
								uni.navigateTo({
									url: `/pagesApp/RealName/RealName`
								});
							} else if (res.cancel) {

								// console.log('用户点击取消');
								// 不执行任何操作，用户取消退出
							}
						}
					});



				}
			},
			ImgSize(event, id) {
				if (event.detail.width > event.detail.height) { // 横图
					this.blog[id].isLongChart = 0
				}
			},
			checkRealNaem() { //判断是否实名
				// if (this.$store.state.user.realName == '' || this.$store.state.user.realName == null) {
				// 	return false
				// } else {
				// 	return true
				// }
				return true
			},
			toim(user) { //跳转到聊天页面
				if (this.$store.state.user.accountType == 1) {
					console.log('打开送礼物弹窗');
					this.OpenSendGiftPopup()
					this.GetSendGiftList()
					return
				}
				if (this.checkRealNaem()) {
					const item = {
						uid: user.id,
						userUid: user.uid,
						name: user.nickname,
						avatar: user.avatar,
						conversationID: 'C2C' + user.uid,
						type: 'C2C'
					}
					uni.navigateTo({
						url: '/message/im/im?to=' + encodeURIComponent(JSON.stringify(item))
					});
				} else {
					uni.showModal({

						content: '你还没有完成实名认证，请先完成实名认证？',
						confirmText: '去实名',
						success: (res) => {
							if (res.confirm) {
								uni.navigateTo({
									url: `/pagesApp/RealName/RealName`
								});
							} else if (res.cancel) {

								// console.log('用户点击取消');
								// 不执行任何操作，用户取消退出
							}
						}
					});
				}
			},
			goBack() {
				manner.goBack()
			},
			changeTabs(type) {
				this.currentTab = type
			},
			changGiftTab(type) {
				this.Loading = true
				this.currentGiftTab = type
				this.params.type = type + 1;
				this.params.pageIndex = 1
				this.gift = [];
				this.getGiftData()
			},
			ChangebosomFriendTab(type) {
				this.bosomFriendTab = type
			},
			gotoBosomFriendValuePage() {
				uni.navigateTo({
					url: '/pagesMain/bosomFriendValue/bosomFriendValue'
				})
			}
		},
		onLoad(options) {
			this.concernParam.fromUid = this.$store.state.user.uid;
			this.param.id = options.id;
			this.blogParam.uid = options.id;
			this.BlockParams.toUid = options.id
			this.getUser()
			this.getBlog()
			this.getGiftData()
			this.addVisitor(options.id)
			// this.getDazi(options.id);
		},
		// mounted() {
		// 	this.concernParam.fromUid=this.$store.state.user.id;
		// }
	}
</script>

<style scoped>
	.avatar-frame {
		position: absolute;
		left: -13rpx;
		top: 203rpx;
		width: 120rpx;
		/* 比头像大 20rpx */
		height: 120rpx;
		/* 比头像大 20rpx */
		z-index: 2;
		/* 调整层级 */
		pointer-events: none;
	}

	.scroll-wrapper {
		width: 100%;
		white-space: nowrap;
	}

	.g-item1 {
		background-color: #fceaf6;
		padding: 16rpx 20rpx;
		min-width: 190rpx;
		height: 50rpx;
		display: inline-flex;
		align-items: center;
		margin-right: 20rpx;
		flex-shrink: 0;
	}

	.game-icon {
		width: 46rpx;
		height: 46rpx;
		flex-shrink: 0;
		/* 防止图标被压缩 */
	}

	.game-name {
		flex: 1;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	/* 隐藏滚动条 */
	::-webkit-scrollbar {
		display: none;
		width: 0;
		height: 0;
		color: transparent;
	}

	.online-status {
		display: inline-block;
		width: 10px;
		/* 可以根据需要调整大小 */
		height: 10px;
		border-radius: 50%;
		/* 使div变成圆形 */
	}

	.threePic {
		width: 200rpx;
		height: 180rpx;
	}

	.MorePic {
		width: 200rpx;
		height: 200rpx;
	}

	.Radio {
		width: 30rpx;
		height: 30rpx;
		border: 1px solid #cdcdcd;
	}

	.ActiveRadio {
		width: 40rpx;
		height: 40rpx;
		background-image: url(https://yuexiaoda-1314351529.cos.ap-shanghai.myqcloud.com/app/%E5%8B%BE%E9%80%89.png);
		background-repeat: no-repeat;
		background-size: 100% 100%;
	}

	.emain {
		background-repeat: no-repeat;
		background-size: cover;
		background-position: 0 100%;
		min-height: 55vh;
		max-height: 55vh;
		position: relative;
	}

	.charts-box {
		width: 300rpx;
		height: 300rpx;
	}

	.color739bce {
		color: #739bce
	}

	.color597bac {
		color: #597bac
	}

	.bgC7C8C9 {
		background: #4b5f87;
		width: 170rpx;
	}

	.plus-img {
		width: 180rpx;
		height: 180rpx;
		border-radius: 36rpx;
		background-color: #1e3767;
		color: #385fa5;
	}

	.colorg7 {
		color: rgba(255, 255, 255, .5)
	}

	.xuanzhe {
		border: 1px solid #C7C8C9;
		border-radius: 30rpx;
		padding: 10rpx 20rpx;
		color: #ffffff;
		font-size: 26rpx;
		margin-right: 20rpx;
		margin-bottom: 20rpx;
	}

	.onxz {
		background: #CFF0FB;
		color: #46C4FF;
	}

	.btn-edit {
		background-image: linear-gradient(to right, #e65fd0, #69adf8);
		width: 38%;
		color: #fff;
		font-size: 36rpx;
		padding: 20rpx;
		border-radius: 50rpx;
	}

	.giftList {
		width: 100%;
		min-height: 770rpx;
		padding-bottom: 150rpx;
		margin-bottom: 30px;
		border-radius: 20rpx;
		display: flex;
		justify-content: left;
		align-content: flex-start;
		flex-wrap: wrap;
	}

	.giftList .item {
		width: 25%;
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-top: 30rpx;
	}

	.giftList .item image {
		width: 80px;
		height: 80px;
	}

	.currentTab {
		font-size: 34rpx;
		color: #231815 !important;
	}

	.currenSendGift {
		border: 2px solid #ed7781 !important;
	}

	.currentGiftTab {
		background-color: #58e0a9;
	}

	.friendtab-b {
		background-image: linear-gradient(to right, #126efb, #2ac3fe);
	}

	.friendtab-p {
		background-image: linear-gradient(45deg, #e322d2, #feae02);
	}

	.friendbtn-bg {
		width: 100rpx;
		height: 100rpx;
		color: #fff;
		font-size: 36rpx;
		border-radius: 50%;
		text-align: center;
		padding: 12rpx;
		background-image: linear-gradient(to right, #5fb1f9, #85f2cb);
	}

	.topic-list {
		margin-bottom: 20rpx;
		display: flex;
		flex-wrap: wrap;
	}

	.topic-content {
		display: flex;
		align-items: center;
		border-radius: 30rpx;
		background: #F0F7FF;
		margin-right: 10px;
	}

	.topic-hash {
		color: #18c3ff;
		font-size: 28rpx;
		margin-right: 3px;
		font-weight: bold;
	}

	.topic-name {
		font-size: 28rpx;
		margin-bottom: 2px;
	}

	.wh215 {
		width: 215rpx;
		height: 215rpx;
	}

	.VipText {
		background: linear-gradient(200deg, #ebdea3 40%, #e69772 100%);
		-webkit-background-clip: text;
		color: transparent;
	}

	.SvipText {
		background: linear-gradient(-90deg, #ee67cd 0%, #a689e3 50%, #5faefd 100%);
		-webkit-background-clip: text;
		color: transparent;
	}
</style>